<ion-item-divider>Status</ion-item-divider>
<ion-item>
  <ion-label class="label">
    <status
      size="x-large"
      weight="600"
      [installProgress]="pkg['install-progress']"
      [rendering]="PR[status.primary]"
      [sigtermTimeout]="pkg.manifest.main['sigterm-timeout']"
    ></status>
  </ion-label>
</ion-item>

<ng-container *ngIf="isInstalled && (connected$ | async)">
  <ion-grid>
    <ion-row style="padding-left: 12px">
      <ion-col>
        <ion-button
          *ngIf="canStop"
          class="action-button"
          color="danger"
          (click)="tryStop()"
        >
          <ion-icon slot="start" name="stop-outline"></ion-icon>
          Stop
        </ion-button>
        <ng-container *ngIf="isRunning">
          <ion-button
            class="action-button"
            color="tertiary"
            (click)="tryRestart()"
          >
            <ion-icon slot="start" name="refresh"></ion-icon>
            Restart
          </ion-button>
        </ng-container>

        <ion-button
          *ngIf="isStopped && pkgStatus?.configured"
          class="action-button"
          color="success"
          (click)="tryStart()"
        >
          <ion-icon slot="start" name="play-outline"></ion-icon>
          Start
        </ion-button>

        <ion-button
          *ngIf="!pkgStatus?.configured"
          class="action-button"
          color="warning"
          (click)="presentModalConfig()"
        >
          <ion-icon slot="start" name="construct-outline"></ion-icon>
          Configure
        </ion-button>

        <ion-button
          *ngIf="pkgStatus && (interfaces | hasUi)"
          class="action-button"
          color="primary"
          [disabled]="
            !(pkg.state | isLaunchable: pkgStatus.main.status:interfaces)
          "
          (click)="launchUi()"
        >
          <ion-icon slot="start" name="open-outline"></ion-icon>
          Launch UI
        </ion-button>
      </ion-col>
    </ion-row>
  </ion-grid>
</ng-container>
